home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: DoIdle
- Sent: 6/15/96 12:29 PM
- Received: 6/17/96 8:22 AM
- From: Arni McKinley, motion@nbn.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Good idea.
-
- Thanks for the info.
-
- Arni
-
- >>I have a LabelShape (a CBaseShape in ODFDraw or Sketch code) that requires
- >>an idler in order to blink the caret in the label. When it gets to be time
- >>to edit the label I make an FW_CEditView then do this:
- >> in EditLabel()
- >> fEditView->Enable(ev);
- >> fEditView->BecomeTarget( ev );
- >>
- >> if( fIdler == NULL )
- >> {
- >> fIdler = FW_NEW(FW_CIdler, (fEditView->GetFrame(ev), 5));
- >> fIdler->RegisterIdle(ev);
- >> }
- >>
- >>Later when the Label is deselected by the user I do this
- >>in SelectLabel( FW_Boolean state )
- >> if( !state)
- >> {
- >> fEditView->Disable(ev);
- >> if( fIdler )
- >> {
- >> fIdler->UnregisterIdle( ev );
- >>
- >> delete fIdler;
- >> fIdler = NULL;
- >> }
- >> }
- >>
- >>Sometime or other, you need to delete the idler. I do it when the Edit View
- >>is deleted
- >> if( fIdler )
- >> {
- >> fIdler->UnregisterIdle( ev );
- >>
- >> delete fIdler;
- >> fIdler = NULL;
- >> }
- >>
- >>Hope this helps
- >>
- >>Arni
- >>
- >>
- >
- >You should not have to create and delete the idler everytime. Calling
- >Register and Unregister should be enough. Have you tried to create the
- >idler when the frame is created and call Register when the edit view
- >becomes the target and Unregister when it looses the target.
- >
- >........................................................................
- > Henri Lamiraux lamiraux@apple.com
- > Apple Computer, Inc. OpenDoc(tm) Development Framework
- >........................................................................
-
-